#include "widget.h"
#include "ui_widget.h"
#include <QHBoxLayout>
#include <QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QHBoxLayout* layout = new QHBoxLayout;
    this->setLayout(layout);

    QPushButton* button1 = new QPushButton(this);
    button1->setText("按钮1");
    layout->addWidget(button1);

    QSpacerItem* spacing = new QSpacerItem(200,50);
    //spacing->changeSize(200,50);
    layout->addSpacerItem(spacing);

    QPushButton* button2 = new QPushButton(this);
    button2->setText("按钮1");
    layout->addWidget(button2);



}

Widget::~Widget()
{
    delete ui;
}

